﻿using System;
using System.Web.Mvc;

using mvcForum.Web.Interfaces;

namespace mvcForum.AddOns.ContentParsing {

	public class RegularParser : IContentParser {

		public MvcHtmlString Parse(String content) {
			// Let's sanitize the input, we don't want HTML to get past the parser and into the output!
			//return MvcHtmlString.Create(content.SanitizeHTML());
			return MvcHtmlString.Create(content.Replace("<", "&lt;").Replace(">", "&gt;").Replace(Environment.NewLine, "<br />"));
		}

		public String Quote(String author, String content) {
			return String.Format("{0} wrote: {1}", author, content);
		}

		public String Name {
			get {
				return "Regular";
			}
		}
	}
}